home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / yacas_alg / yacas_morphos / share / yacas / include / genericstructs.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-13  |  1.2 KB  |  37 lines

  1. /** \file genericstructs.h defines the class that handles structs and classes for plugins.
  2.  */
  3. #ifndef __genericstruct_h__
  4. #define __genericstruct_h__
  5.  
  6. #include "yacasbase.h"
  7. #include "genericobject.h"
  8.  
  9. /** \class GenericStruct This class maintains a pointer to some arbitrary
  10.  *  object (which can be any thing). The plugin is responsible for supplying
  11.  *  functions for manipulating such structs/classes/arrays. The Yacas core
  12.  *  then needs to know nothing about the internals of such a struct.
  13.  *
  14.  *  The struct is represented by a void pointer to the struct, a pointer
  15.  *  to a function that can clean up the struct (used when automatically
  16.  *  deleting the object), and a pointer to a text string representing the
  17.  *  type of the object (useful for testing if the type passed as an argument
  18.  *  to a function is correct).
  19.  */
  20. class GenericStruct : public GenericClass
  21. {
  22. public:
  23.     GenericStruct(LispCharPtr aTypeName, void* aData, void (*aDestructor)(void*));
  24.     virtual ~GenericStruct();
  25.     virtual LispCharPtr Send(LispArgList& aArgList);
  26.     virtual LispCharPtr TypeName();
  27.     inline void* Data() {return iData;}
  28. public:
  29.     void* iData;
  30.     LispCharPtr iTypeName;
  31.     void (*iDestructor)(void* data);
  32. };
  33.  
  34.  
  35. #endif
  36.  
  37.